From: Jonas Dreßler Date: Mon, 1 Feb 2021 10:40:50 +0000 (+0100) Subject: workspace: Don't store strategy on layout object X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~518 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a4bf44734d8e8f5e3efc852db794bf6bfbc2c918;p=gnome-shell.git workspace: Don't store strategy on layout object We're making the layout object fully owned by the layout strategy, so store the current strategy somewhere else, that is as a private property of the class. Part-of: --- diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 6a8e999b2..383c1e939 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -487,7 +487,7 @@ var WorkspaceLayout = GObject.registerClass({ // We look for the largest scale that allows us to fit the // largest row/tallest column on the workspace. - const strategy = new UnalignedLayoutStrategy({ + this._layoutStrategy = new UnalignedLayoutStrategy({ monitor: Main.layoutManager.monitors[this._monitorIndex], rowSpacing, columnSpacing, @@ -507,12 +507,11 @@ var WorkspaceLayout = GObject.registerClass({ if (numColumns === lastNumColumns) break; - const layout = strategy.computeLayout(this._sortedWindows, { + const layout = this._layoutStrategy.computeLayout(this._sortedWindows, { numRows, }); - layout.strategy = strategy; - const [scale, space] = strategy.computeScaleAndSpace(layout, area); + const [scale, space] = this._layoutStrategy.computeScaleAndSpace(layout, area); if (!this._isBetterScaleAndSpace(lastScale, lastSpace, scale, space)) break; @@ -537,7 +536,7 @@ var WorkspaceLayout = GObject.registerClass({ height: parseInt(containerBox.get_height()), }; - return this._layout.strategy.computeWindowSlots(this._layout, availArea); + return this._layoutStrategy.computeWindowSlots(this._layout, availArea); } _getAdjustedWorkarea(container) {